<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Goodwill - Каталог товаров</title>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <link rel="stylesheet" href="resources/css/stylesheet.css"/>
    <link rel="stylesheet" href="resources/css/clients.css"/>
    <style type="text/css">
    </style>
</head>
<body>
<f:view>
    <jsp:include page="menu.jsp"/>
    <jsp:include page="status.jsp"/>
    <jsp:include page="messages.jsp"/>
    <h:form>

    <br>
    <h:panelGrid columns="2" cellpadding="0" cellspacing="0" columnClasses="top,top">
        <h:panelGroup styleClass="" layout="block" style="padding:5px">
            <a4j:repeat value="#{TextBean.textBlocks}" var="textBlock">
                <a4j:commandLink value="#{textBlock.name}" ajaxSingle="#" reRender="textBlock" style="font-size:100%;font-weight:bold">
                    <a4j:actionparam name="id" assignTo="#{TextBean.textBlockId}" value="#{textBlock.key}"/>
                </a4j:commandLink><br>
            </a4j:repeat>

        </h:panelGroup>
        <h:panelGroup id="textBlock">
            <h:inputHidden value="#{TextBean.textBlockId}"/>
            <rich:editor id="editor" width="600" height="400" value="#{TextBean.text}"/><br>
            <a4j:commandButton value="Сохранить" action="#{TextBean.save}"/>
        </h:panelGroup>
    </h:panelGrid>

</h:form>

</f:view>
</body>
</html>
